{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
                <div class="box-header with-border">
                    <span class="fa fa-pencil" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">备课组列表</p>
					
                    <a href="index.php?a=prepare.preparebatch" class="btn btn-primary btn-sm" style="float:right; color:#fff;"> 批量生成 </a>
					<a href="index.php?a=prepare.prepareadd" class="btn btn-info btn-sm" style="float:right; color:#fff; margin-right:8px;"> 自定义 </a>
                
				</div>
                <div class="box-body">
                  <table class="table table-bordered table-striped"  id="mytable">
                                <thead>
                                    <tr style="background-color:#fcba4b;">
                                        <td>备课组名称</td>
										<td>成员</td>
                                        <td width="300">操作</td>
                                    </tr>	
                                </thead>

                                <tbody>
                                {%foreach from=$prepare_lists key=key item=value%}
                                    <tr>
                                        <td>{%$value.prepare_name%}</td>
										<td>
										{%foreach from=$value.staff_name key=k item=v%}
											{%$v%} 
										{%/foreach%}
										</td>
                                        <td>
                                        	  <a href="index.php?a=prepare.prepareUpdate&prepare_id={%$value.prepare_id%}" class="btn btn-warning btn-sm" title="修改"><i class="fa fa-edit (alias)"></i></a>
											  <a href="#" class="btn btn-success btn-sm" title="添加成员"  data-toggle="modal" data-target="#myModal" onclick="shows('{%$value.prepare_id%}')"> <i class="fa fa-user" ></i> </a>
											  <a href="index.php?a=prepare.preparedel&prepare_id={%$value.prepare_id%}" class="btn btn-danger btn-sm" title="删除"
 onclick="if(confirm('警告！确认删除信息?')==false)return false;"> <i class="fa fa-trash"></i></a>
                                        </td>
                                    </tr>	
                                
                               	{%/foreach%}   
                                	
                            </tbody>
                        </table>
						<div class="box-footer">
						{%$page%}
						</div>
				</div><!--box-body -->
           </div><!--box box-default box-solid-->
        </section>   
      </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
   <!--弹出框--> 
<form  method="post" action="" >
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <h4 class="modal-title" id="myModalLabel">选择部门成员</h4>
          </div>
          <div class="modal-body">
			{%foreach from=$staff_lists key=key item=value%}	
                <label class="choice"><input type="checkbox" name="staff_id[]" value="{%$value.staff_id%}">{%$value.staff_name%}</label>
           {%/foreach%}	
          </div>
          <div class="modal-footer">
			 <input type="hidden" name="prepare_id" value="" id ="aa">
            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            <button type="submit" class="btn btn-primary">保存</button>
          </div>
        </div>
      </div>
    </div>
	
</form>
 <!-- Modal -->
{%include file="index.footer.tpl.php"%}
<script>
function shows(a)
   {
	$("#aa").val(a);
	}

</script>

